package com.jumi.microservice.domain.vo;

import com.jumi.microservice.common.base.AbstractObject;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.List;

/**
 * 账号VO类
 *
 * @author Administrator
 */
@ApiModel(value = "账号值对象", description = "账号值对象")
public class UserAccountVO extends AbstractObject implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    private Long id;

    @ApiModelProperty(value = "用户账号")
    @NotNull(message = "用户账号不能为空")
    @Length(min = 3, max = 12, message = "用户账号长度要求{min}到{max}之间")
    @Pattern(regexp = "^[a-zA-Z]+[0-9]+", message = "用户账号必须为字母数字组成")
    private String userAccount;

    @ApiModelProperty(value = "用户姓名")
    @NotNull(message = "用户姓名不能为空")
    @Length(min = 2, max = 10, message = "用户姓名长度要求{min}到{max}之间")
    @Pattern(regexp = "^[\u4e00-\u9fa5]*$", message = "用户姓名必须为汉字")
    private String userName;

    @ApiModelProperty(value = "密码")
    @NotNull(message = "用户密码不能为空")
    @Length(min = 6, max = 12, message = "用户密码长度要求{min}到{max}之间")
    @Pattern(regexp = "^[\\da-zA-Z!@#$%^&*]*$", message = "用户密码必须为字母数字符号组成")
    private String password;

    @ApiModelProperty(value = "手机号码")
    @NotNull(message = "手机号码不能为空")
    @Pattern(regexp = "^\\d{11}$", message = "手机号码必须为11位数字")
    private String mobile;

    @ApiModelProperty(value = "用户头像")
    private String userAvatar;


    @ApiModelProperty(value = "部门主键ID")
    private Long departmentId;

    @ApiModelProperty(value = "角色主键ID数组")
    private List<Long> roleRelations;


    @ApiModelProperty(value = "是部门负责人(0:否,1:是)")
    private Integer isLeader;

    public String getUserAccount() {
        return userAccount;
    }

    public void setUserAccount(String userAccount) {
        this.userAccount = userAccount;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getUserAvatar() {
        return userAvatar;
    }

    public void setUserAvatar(String userAvatar) {
        this.userAvatar = userAvatar;
    }

    public Long getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(Long departmentId) {
        this.departmentId = departmentId;
    }

    public List<Long> getRoleRelations() {
        return roleRelations;
    }

    public void setRoleRelations(List<Long> roleRelations) {
        this.roleRelations = roleRelations;
    }

    public Integer getIsLeader() {
        return isLeader;
    }

    public void setIsLeader(Integer isLeader) {
        this.isLeader = isLeader;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "UserAccountVO{" +
                "id=" + id +
                ", userAccount='" + userAccount + '\'' +
                ", userName='" + userName + '\'' +
                ", password='" + password + '\'' +
                ", mobile='" + mobile + '\'' +
                ", userAvatar='" + userAvatar + '\'' +
                ", departmentId=" + departmentId +
                ", roleRelations=" + roleRelations +
                ", isLeader=" + isLeader +
                '}';
    }
}
